package com.joysuch.wwyt.streampusher;

import org.redisson.api.RTopic;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author jiahao
 * @date 2020/7/30 18
 */
@Component
public class DefaultRedisBroker {

    @Autowired
    private RedissonClient redissonClient;

    public void bindTopic(String topic, JsRedisSubscriber jsRedisSubscriber) {
        RTopic<Object> redisTopic = redissonClient.getTopic(topic);
        redisTopic.addListener(jsRedisSubscriber);
    }


}
